package com.projectsquirrel;


import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TableLayout;
import android.widget.TextView;



/**
 * 
 */
public class infoMenu extends Activity 
{
	TextView FAQTitle1 ;
	TextView FAQTitle2 ;
	TextView FAQTitle3 ;
	
	TableLayout picLayout1;

	
	//-----
	TextView FAQContent1;
	TextView FAQContent2;
	TextView FAQContent3;
	
	boolean hideFAQ[] = {true,true,true};

	String data[] ={
		"Squirrels are useful organisms to study because they are active during the day and " +
		"everyone has an opinion about them. Additionally, squirrels can be important indicators " +
		"of local ecology because they are resident in small territories and active year round, they require a range of " +
		"resources that are also important to many other urban animals, and their populations rise " +
		"and fall with the same predators and environmental conditions that affect our neighborhood wildlife. "	,
		
		"Fox squirrels have a rusty belly and a black outline to their tail throughout most of the" +
		" country. Gray Squirrels typically have a white belly and the tail looks frosted in white. In " +
		"many places you may see Gray squirrels that are all black and in a few places you may see a white " +
		"one. Grey squirrel adults are also smaller than Fox squirrels. ",
		
		"Fruit bearing trees - Produce fruits.\n" +
		"Nut bearing trees - Produce nuts.\n" +
		"Coniferous trees - Cone-bearing seed trees. "
		
		
		
	};
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	    setContentView(R.layout.infomenu);
	    FAQTitle1 = (TextView) findViewById(R.id.faqTitle1);
	    FAQTitle2 = (TextView) findViewById(R.id.faqTitle2);
		FAQTitle3 = (TextView) findViewById(R.id.faqTitle3);
		/*FAQTitle4 = (TextView) findViewById(R.id.faqTitle4);
		FAQTitle5 = (TextView) findViewById(R.id.faqTitle5);
		FAQTitle6 = (TextView) findViewById(R.id.faqTitle6);
		FAQTitle7 = (TextView) findViewById(R.id.faqTitle7);
		FAQTitle8 = (TextView) findViewById(R.id.faqTitle8);
		FAQTitle9 = (TextView) findViewById(R.id.faqTitle9);
		FAQTitle10 = (TextView) findViewById(R.id.faqTitle10);
		FAQTitle11 = (TextView) findViewById(R.id.faqTitle11);*/
		//-----
		FAQContent1 = (TextView) findViewById(R.id.faqContent1);
		FAQContent2 = (TextView) findViewById(R.id.faqContent2);
		FAQContent3 = (TextView) findViewById(R.id.faqContent3);
	/*	FAQContent4 = (TextView) findViewById(R.id.faqContent4);
		FAQContent5 = (TextView) findViewById(R.id.faqContent5);
		FAQContent6 = (TextView) findViewById(R.id.faqContent6);
		FAQContent7 = (TextView) findViewById(R.id.faqContent7);
		FAQContent8 = (TextView) findViewById(R.id.faqContent8);
		FAQContent9 = (TextView) findViewById(R.id.faqContent9);
		FAQContent10 = (TextView) findViewById(R.id.faqContent10);
		FAQContent11 = (TextView) findViewById(R.id.faqContent11);*/
		
		picLayout1 = (TableLayout) findViewById(R.id.picLayout);
		String FaqQ1 = "Why Squirrels?";
		String FaqQ2 = "Difference between Fox and Gray Squirrels?";
		String FaqQ3 = "Different types of trees?";
		
		FAQTitle1.setText(FaqQ1);
		FAQTitle2.setText(FaqQ2);
		FAQTitle3.setText(FaqQ3);
		
	}
	
	public void onClickTitle(View v){
		
		 switch(v.getId()){
		 case R.id.faqTitle1:
			 FAQContent1.setText(data[0]);
			 FAQContent1.setVisibility(View.VISIBLE);
			 
			 if(!hideFAQ[0]){
				 FAQContent1.setVisibility(View.GONE);
				 hideFAQ[0]=true;
			 }
			 else{
				 hideFAQ[0] = false;
				 hideFAQ[1] = true;
				 hideFAQ[2] = true;
				 
				 FAQContent2.setVisibility(View.GONE);
				 FAQContent3.setVisibility(View.GONE);
				 
				 picLayout1.setVisibility(View.GONE);
			 }
			 
			 break;
		 case R.id.faqTitle2:
			 FAQContent2.setText(data[1]);
			 FAQContent2.setVisibility(View.VISIBLE);
			 
			 if(!hideFAQ[1]){
				 FAQContent2.setVisibility(View.GONE);
				 hideFAQ[1]=true;
			 }
			 else{
				 hideFAQ[1] = false;
				 hideFAQ[0] = true;
				 hideFAQ[2] = true;
				 
				 FAQContent1.setVisibility(View.GONE);
				 FAQContent3.setVisibility(View.GONE);
				 
				 picLayout1.setVisibility(View.GONE);
			 }
			 
			 break;
		 case R.id.faqTitle3:
			 FAQContent3.setText(data[2]);
			
			 FAQContent3.setVisibility(View.VISIBLE);
			 if(!hideFAQ[2]){
				 FAQContent3.setVisibility(View.GONE);
				 hideFAQ[2]=true;
			 }
			 else{
				 hideFAQ[2] = false;
				 hideFAQ[1] = true;
				 hideFAQ[0] = true;
				
				 FAQContent1.setVisibility(View.GONE);
				 FAQContent2.setVisibility(View.GONE);
				 picLayout1.setVisibility(View.GONE);
			 }
			 
			 break;
		/* case R.id.faqTitle4:
			 FAQContent4.setText(data[3]);
			 FAQContent4.setVisibility(View.VISIBLE);

			 
			 if(!hideFAQ[3]){
				 FAQContent4.setVisibility(View.GONE);
				 hideFAQ[3]=true;
			 }
			 else{
				 hideFAQ[3] = false;
				 hideFAQ[1] = true;
				 hideFAQ[2] = true;
				 hideFAQ[0] = true;
				 hideFAQ[4] = true;
				 hideFAQ[5] = true;
				 hideFAQ[6] = true;
				 hideFAQ[7] = true;
				 hideFAQ[8] = true;
				 hideFAQ[9] = true;
				 hideFAQ[10] = true;
				 FAQContent1.setVisibility(View.GONE);
				 FAQContent2.setVisibility(View.GONE);
				 FAQContent3.setVisibility(View.GONE);
				 FAQContent5.setVisibility(View.GONE);
				 FAQContent6.setVisibility(View.GONE);
				 FAQContent7.setVisibility(View.GONE);
				 FAQContent8.setVisibility(View.GONE);
				 FAQContent9.setVisibility(View.GONE);
				 FAQContent10.setVisibility(View.GONE);
				 FAQContent11.setVisibility(View.GONE);
				 picLayout1.setVisibility(View.GONE);
			 }
			 
			 break;
		 case R.id.faqTitle5:
			 FAQContent5.setText(data[4]);
			 FAQContent5.setVisibility(View.VISIBLE);

			 
			 if(!hideFAQ[4]){
				 FAQContent5.setVisibility(View.GONE);
				 hideFAQ[4]=true;
			 }
			 else{
				 hideFAQ[4] = false;
				 hideFAQ[1] = true;
				 hideFAQ[2] = true;
				 hideFAQ[3] = true;
				 hideFAQ[0] = true;
				 hideFAQ[5] = true;
				 hideFAQ[6] = true;
				 hideFAQ[7] = true;
				 hideFAQ[8] = true;
				 hideFAQ[9] = true;
				 hideFAQ[10] = true;
				 FAQContent1.setVisibility(View.GONE);
				 FAQContent2.setVisibility(View.GONE);
				 FAQContent3.setVisibility(View.GONE);
				 FAQContent4.setVisibility(View.GONE);
				 FAQContent6.setVisibility(View.GONE);
				 FAQContent7.setVisibility(View.GONE);
				 FAQContent8.setVisibility(View.GONE);
				 FAQContent9.setVisibility(View.GONE);
				 FAQContent10.setVisibility(View.GONE);
				 FAQContent11.setVisibility(View.GONE);
				 picLayout1.setVisibility(View.GONE);
			 }
			 
			 break;
		 case R.id.faqTitle6:
			 FAQContent6.setText(data[5]);
			 FAQContent6.setVisibility(View.VISIBLE);

			 
			 if(!hideFAQ[5]){
				 FAQContent6.setVisibility(View.GONE);
				 hideFAQ[5]=true;
			 }
			 else{
				 hideFAQ[5] = false;
				 hideFAQ[1] = true;
				 hideFAQ[2] = true;
				 hideFAQ[3] = true;
				 hideFAQ[4] = true;
				 hideFAQ[0] = true;
				 hideFAQ[6] = true;
				 hideFAQ[7] = true;
				 hideFAQ[8] = true;
				 hideFAQ[9] = true;
				 hideFAQ[10] = true;
				 FAQContent1.setVisibility(View.GONE);
				 FAQContent2.setVisibility(View.GONE);
				 FAQContent3.setVisibility(View.GONE);
				 FAQContent4.setVisibility(View.GONE);
				 FAQContent5.setVisibility(View.GONE);
				 FAQContent7.setVisibility(View.GONE);
				 FAQContent8.setVisibility(View.GONE);
				 FAQContent9.setVisibility(View.GONE);
				 FAQContent10.setVisibility(View.GONE);
				 FAQContent11.setVisibility(View.GONE);
				 picLayout1.setVisibility(View.GONE);
			 }
			 break;
		 case R.id.faqTitle7:
			 FAQContent7.setText(data[6]);
			 FAQContent7.setVisibility(View.VISIBLE);

			 
			 if(!hideFAQ[6]){
				 FAQContent7.setVisibility(View.GONE);
				 hideFAQ[6] = true;
			 }
			 else{
				 hideFAQ[6] = false;
				 hideFAQ[1] = true;
				 hideFAQ[2] = true;
				 hideFAQ[3] = true;
				 hideFAQ[4] = true;
				 hideFAQ[5] = true;
				 hideFAQ[0] = true;
				 hideFAQ[7] = true;
				 hideFAQ[8] = true;
				 hideFAQ[9] = true;
				 hideFAQ[10] = true;
				 FAQContent1.setVisibility(View.GONE);
				 FAQContent2.setVisibility(View.GONE);
				 FAQContent3.setVisibility(View.GONE);
				 FAQContent4.setVisibility(View.GONE);
				 FAQContent5.setVisibility(View.GONE);
				 FAQContent6.setVisibility(View.GONE);
				 FAQContent8.setVisibility(View.GONE);
				 FAQContent9.setVisibility(View.GONE);
				 FAQContent10.setVisibility(View.GONE);
				 FAQContent11.setVisibility(View.GONE);
				 picLayout1.setVisibility(View.GONE);
			 }
			 break;
		 case R.id.faqTitle8:
			 FAQContent8.setText(data[7]);
			 FAQContent8.setVisibility(View.VISIBLE);

			 
			 if(!hideFAQ[7]){
				 FAQContent8.setVisibility(View.GONE);
				 hideFAQ[7]=true;
			 }
			 else{
				 hideFAQ[7] = false;
				 hideFAQ[1] = true;
				 hideFAQ[2] = true;
				 hideFAQ[3] = true;
				 hideFAQ[4] = true;
				 hideFAQ[5] = true;
				 hideFAQ[6] = true;
				 hideFAQ[0] = true;
				 hideFAQ[8] = true;
				 hideFAQ[9] = true;
				 hideFAQ[10] = true;
				 FAQContent1.setVisibility(View.GONE);
				 FAQContent2.setVisibility(View.GONE);
				 FAQContent3.setVisibility(View.GONE);
				 FAQContent4.setVisibility(View.GONE);
				 FAQContent5.setVisibility(View.GONE);
				 FAQContent6.setVisibility(View.GONE);
				 FAQContent7.setVisibility(View.GONE);
				 FAQContent9.setVisibility(View.GONE);
				 FAQContent10.setVisibility(View.GONE);
				 FAQContent11.setVisibility(View.GONE);
				 picLayout1.setVisibility(View.GONE);
			 }
			 break;
		 case R.id.faqTitle9:
			 FAQContent9.setText(data[8]);
			 FAQContent9.setVisibility(View.VISIBLE);

			 
			 if(!hideFAQ[8]){
				 FAQContent9.setVisibility(View.GONE);
				 hideFAQ[8] = true;
			 }
			 else{
				 hideFAQ[8] = false;
				 hideFAQ[1] = true;
				 hideFAQ[2] = true;
				 hideFAQ[3] = true;
				 hideFAQ[4] = true;
				 hideFAQ[5] = true;
				 hideFAQ[6] = true;
				 hideFAQ[7] = true;
				 hideFAQ[0] = true;
				 hideFAQ[9] = true;
				 hideFAQ[10] = true;
				 FAQContent1.setVisibility(View.GONE);
				 FAQContent2.setVisibility(View.GONE);
				 FAQContent3.setVisibility(View.GONE);
				 FAQContent4.setVisibility(View.GONE);
				 FAQContent5.setVisibility(View.GONE);
				 FAQContent6.setVisibility(View.GONE);
				 FAQContent7.setVisibility(View.GONE);
				 FAQContent8.setVisibility(View.GONE);
				 FAQContent10.setVisibility(View.GONE);
				 FAQContent11.setVisibility(View.GONE);
				 picLayout1.setVisibility(View.GONE);
			 }
			 break;
		 case R.id.faqTitle10:
			 FAQContent10.setText(data[9]);
			 FAQContent10.setVisibility(View.VISIBLE);
			 
			 if(!hideFAQ[9]){
				 FAQContent10.setVisibility(View.GONE);
				 hideFAQ[9]=true;
			 }
			 else{
				 hideFAQ[9] = false;
				 hideFAQ[1] = true;
				 hideFAQ[2] = true;
				 hideFAQ[3] = true;
				 hideFAQ[4] = true;
				 hideFAQ[5] = true;
				 hideFAQ[6] = true;
				 hideFAQ[7] = true;
				 hideFAQ[8] = true;
				 hideFAQ[0] = true;
				 hideFAQ[10] = true;
				 FAQContent1.setVisibility(View.GONE);
				 FAQContent2.setVisibility(View.GONE);
				 FAQContent3.setVisibility(View.GONE);
				 FAQContent4.setVisibility(View.GONE);
				 FAQContent5.setVisibility(View.GONE);
				 FAQContent6.setVisibility(View.GONE);
				 FAQContent7.setVisibility(View.GONE);
				 FAQContent8.setVisibility(View.GONE);
				 FAQContent9.setVisibility(View.GONE);
				 FAQContent11.setVisibility(View.GONE);
				 picLayout1.setVisibility(View.GONE);
			 }
			 break;
		 case R.id.faqTitle11:
			 FAQContent11.setText(data[10]);
			 FAQContent11.setVisibility(View.VISIBLE);
			 
			 if(!hideFAQ[10]){
				 FAQContent11.setVisibility(View.GONE);
				 hideFAQ[10]=true;
			 }
			 else{
				 hideFAQ[10] = false;
				 hideFAQ[1] = true;
				 hideFAQ[2] = true;
				 hideFAQ[3] = true;
				 hideFAQ[4] = true;
				 hideFAQ[5] = true;
				 hideFAQ[6] = true;
				 hideFAQ[7] = true;
				 hideFAQ[8] = true;
				 hideFAQ[9] = true;
				 hideFAQ[0] = true;
				 FAQContent1.setVisibility(View.GONE);
				 FAQContent2.setVisibility(View.GONE);
				 FAQContent3.setVisibility(View.GONE);
				 FAQContent4.setVisibility(View.GONE);
				 FAQContent5.setVisibility(View.GONE);
				 FAQContent6.setVisibility(View.GONE);
				 FAQContent7.setVisibility(View.GONE);
				 FAQContent8.setVisibility(View.GONE);
				 FAQContent9.setVisibility(View.GONE);
				 FAQContent10.setVisibility(View.GONE);
				 picLayout1.setVisibility(View.GONE);
			 }
			 break;*/
		 default:
			
			break;
		 }
	}
	
	public void openURL(View v){
		Uri uri = Uri.parse("http://zip4.usps.com/zip4/welcome.jsp");
		 Intent intent = new Intent(Intent.ACTION_VIEW, uri);
		 startActivity(intent);
	}
	public void openEmail(View v){
		Intent intent = new Intent(Intent.ACTION_SEND);
		intent.setType("text/html");
		intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"sciurus@uic.edu"});
		intent.putExtra(Intent.EXTRA_SUBJECT, "Project Squirrel");		
		startActivity(Intent.createChooser(intent, "sending mail"));
	}
}
